﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MisprintTestingTool
{
    class TextControl : TextBox
    {
        public delegate void OnKeyMessage(char ch);

        public event OnKeyMessage OnKeyMessageEvent = null;

        protected override bool ProcessKeyMessage(ref Message m)
        {
            if ((m.Msg == 0x102) || (m.Msg == 0x106))
            {
                char c = (char)m.WParam;

                if (OnKeyMessageEvent != null)
                    OnKeyMessageEvent(c);
            }

            return base.ProcessKeyMessage(ref m);
        }
    }
}
